package com.victor.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.victor.dao.CategoryDao;
import com.victor.entity.Category;
import com.victor.service.CategoryService;

@Service
public class CategoryServiceImpl implements CategoryService {

	@Autowired
	private CategoryDao dao;

	@Override
	public boolean batchDelete(int[] ids) {
		return dao.batchDelete(ids) > 0 ? true : false;
	}

	@Override
	public boolean insert(Category record) {
		return dao.insert(record) > 0 ? true : false;
	}

	@Override
	public Category findById(Integer cId) {
		return dao.findById(cId);
	}

	@Override
	public boolean update(Category record) {
		return dao.update(record) > 0 ? true : false;
	}

	@Override
	public List<Category> getPicCategory() {
		return dao.getCategory(new Category(null, null, "1"));
	}

	@Override
	public List<Category> getAudioCategory() {
		return dao.getCategory(new Category(null, null, "2"));
	}

}
